<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <img src="//tva1.sinaimg.cn/large/007c1Ltfgy1h0plytaly5j32yo1o0tj6.jpg" />

    <script>
      let contentLoadedTime;
      let onloadTime;
      document.addEventListener("DOMContentLoaded", function () {
        console.log("DOMContentLoaded:");
        contentLoadedTime = performance.now();
      });
      window.onload = function () {
        console.log("onload:");
        onloadTime = performance.now();

        console.log("gap:", onloadTime - contentLoadedTime);
      };
    </script>
  </body>
</html>
